﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing; 
using VisualJS;
using VisualJS.Web.Forms;
using System.Linq;
using System.Text;

namespace VisualJSControlsSample.SampleForms
{
    public partial class RadioButtonTest : VisualJS.Web.Forms.Form
    {

#region Constructors
        public RadioButtonTest()
        {
            InitializeComponent();
            AfterInitialization();
        } 

        //Use the below constructor if you create the instance of this Form object other than the active Thread
        //otherwise you will receive "Cant locate the ClientID in active context. Consider using Form constructor with ClientID parameter" exception
        public RadioButtonTest(string clientId): base(clientId)
        {
            InitializeComponent(); 
            AfterInitialization();
        }
#endregion

        //Use below method for the tasks after the initialization of the Form
        void  AfterInitialization()
        {

        }

        private void rdRed_CheckedChanged(object sender, EventArgs e)
        {
            RadioButton s = (RadioButton)sender;
            switch (s.Text)
            {
                case "Red":
                    this.pnlColor.BackColor = Color.Red;
                    break;
                case "Green":
                    this.pnlColor.BackColor = Color.Green;
                    break;
                case "Blue":
                    this.pnlColor.BackColor = Color.Blue;
                    break;
            }
        }

        private void radioButton3_CheckedChanged(object sender, EventArgs e)
        {
            RadioButton s = (RadioButton)sender;
            switch (s.Text)
            {
                case "Orange":
                    this.pnlColor2.BackColor = Color.Orange;
                    break;
                case "Brown":
                    this.pnlColor2.BackColor = Color.Brown;
                    break;
                case "Olive":
                    this.pnlColor2.BackColor = Color.Olive;
                    break;
            }
        }
    }
}